<?php
include("common/header.html");
include("../_made/le.cfg.php");
include("/var/www/html/new/conf/yd.le.je");
$ydle=new yd_go_sql();
$ydle->connect(); 
include("common/left.html");
$id=$_REQUEST['id'];
$sql="select * from uu_tra_route where id=$id";
$result=$GLOBALS['ydle']->query($sql);
while($row=$GLOBALS['ydle']->fetch_assoc($result)){
	$lists[]=$row;
	}
	//print_r($lists);
$topic=$_REQUEST['topic'];
$content=$_REQUEST['content'];
$time=date('Y-m-d h:i:s');
if($_REQUEST['action']=='保存'){
    if($topic!=""&&$content!=""){
        $sql="update uu_tra_route set topic='$topic',edit_date='$time',content='$content' where id=$id";
        $GLOBALS['ydle']->query($sql);
        echo "success";
    }else{
        echo "cant't be blank";
    }
}else if($_REQUEST['action']=='发布'){
    if($topic!=""&&$content!=""){
        $sql="update uu_tra_route set topic='$topic',edit_date='$time',content='$content',status='1' where id=$id";
        $GLOBALS['ydle']->query($sql);
        echo "success";
}else{
    echo "can't be blank";
}
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="http://www.12301.cc/css/page.css" media="all">
<div class="r_content" id="bind_tao">
    <h3 class="mc_title">
        <span class="mctit_1"><span class="mctit_2">路线管理</span></span>
    </h3>
	<div class="qunaertong">
		<!--<iframe name="ifr" style="display:none;"></iframe>-->
		<form action="#" method="post" name="form" enctype="multipart/form-data">
		<?foreach($lists as $list){?>
		<input name="id" type="hidden" value="<?=$id?>">
			<p>
				<b class="tit">路线名称:</b>
				<span class="con1"><input type="text" class="inpcon" value="<?=$list['topic']?>" maxlength="4" id="ch_ops" name="topic"/></span>
				<b class="tit">（最多可输入4个字符）</b>
			</p>
			<p>
				<b class="tit">路线描述:</b>
				<span class="con1"><textarea name="content" value="<?=$list['content']?>" maxlength="240" style="margin: 0px; width: 301px; height: 212px;"><?=$list['content']?></textarea></span>
				<b class="tit">（最多可以输入240个字符）</b>
			</p>

			<p>
				<input type="submit" class="ok_r" id="Submit" name="action" value="保存" />
				<input type="submit" class="ok_r" id="Submit" name="action" value="发布" />
			</p>
			<?}?>
		</form>
	</div> 
</div>

<?include("common/footer.html")?>